var isWx=false;
wx.miniProgram.getEnv(function(res) {
    if(res.miniprogram){
        //小程序
        isWx=true;
    }else{
        isWx=false;
    }
});
//首页
function goIndex(memberId,cityId){
    if (cityId == null || cityId == "" || cityId == undefined || cityId == "") {
        cityId = "";
    }
    window.location.href="/weChat/index?memberId="+memberId+"&cityId="+cityId;
}

//商品详情
function goItem(memberId,id){
    if(isWx){
        wx.miniProgram.navigateTo({url: '/pages/index/index?url=/weChat/item&urlParam=id*'+id});
    }else{
        window.location.href="/weChat/item?memberId="+memberId+"&id="+id;
    }
}
//下单页面
function goItemBuy(memberId,id){
    if(isWx){
        wx.miniProgram.navigateTo({url: '/pages/index/index?url=/weChat/itemBuy&urlParam=id*'+id});
    }else{
        window.location.href="/weChat/itemBuy?memberId="+memberId+"&id="+id;
    }
}
//我的
function goMy(memberId){
    window.location.href="/weChat/my?memberId="+memberId;
}
//订单列表
function goDetailList(memberId,state){
    if(isWx){
        wx.miniProgram.navigateTo({url: '/pages/index/index?url=/weChat/detailList&urlParam=state*'+state});
    }else{
        window.location.href="/weChat/detailList?memberId="+memberId+"&state="+state;
    }
}